﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<VideoBlog.Web.Models.PlaylistViewModel>" %>

<div class="player">
    <div class="imagecontainer">
        <div class="image">
        <%  
        if (Model.Image != null) 

           {%>
           <a href="/watch/<%=Model.NowPlaying.Playlist.PlaylistID %>/<%= Model.NowPlaying.VideoID %>/<%=Model.NowPlaying.Playlist.Slug %>/<%= Model.NowPlaying.Slug %>">
           <img src="/Content/images/playlists/<%=Model.Image %>" alt="" />
           </a>
        <%} else { %>
             <iframe width="640" height="360" src="http://www.youtube.com/embed/<%=Model.NowPlaying.VideoProviderID %>?rel=0&amp;autoplay=1" frameborder="0" allowfullscreen></iframe>
             <%} %>
        </div>
   </div>
    <div class="playlistcontainer">
    <ul>
    <li class="title">Full playlist</li>
    <% foreach (VideoBlog.Data.Entities.Video v in Model.Videos.Take(5))
       { %>
        <li>
        <% Html.RenderPartial("PlaylistItem", v); %>
        </li>
     <%} %>
    </ul>
    </div>
</div>
